package cn.pink.gamesrv.human;

import cn.pink.common.support.tools.rpc.RpcTool;
import cn.pink.core.CallPoint;
import lombok.Getter;
import lombok.Setter;

/**
 * @Author: pink
 * @Date: 2022/7/7 11:13
 */
public class HumanObject {
    /** 玩家id */
    @Getter
    private String id;

    /** sessionPoint */
    @Getter
    @Setter
    private CallPoint sessionPoint;

    @Getter
    private HumanObjectService humanObjSrv;

    /** 正在登陆中 */
    @Getter
    private boolean logging = true;

    /** 登录的token */
    private String token = "";

    /** 开放平台id */
    private String userIdentity = "";

    public HumanObject(String id, CallPoint sessionPoint, String userIdentity, String token, HumanObjectService humanObjSrv) {
        this.id = id;
        this.sessionPoint = sessionPoint;
        this.token = token;
        this.userIdentity = userIdentity;
        this.humanObjSrv = humanObjSrv;

        //TODO 加载数据
        loadData();
    }

    private void loadData() {
        RpcTool.getInstance().findHuman("abv", db ->{
            System.out.println(db);
        });
    }
}
